﻿Imports System.Data
Imports System.Data.SqlClient

Public Class AlertaDocumentoAlmacenPickeadorDatos

    Sub ingresarAlertaAlmacenPickeador(ByVal pedido As String, ByVal pickeador As String, ByVal usuario As String, ByVal mensaje As String, prio As String, cia As String, suc As String, tdoc As String, evento As String)
        Dim conex As New Conexion
        Dim coneccion As SqlConnection = conex.conectar()
        coneccion.Open()
        Dim query As String = "INSERT INTO ALER_Documento_Almacen_Persona(CIA,SUC_Codigo, " &
                              "TDOC_Codigo,DAL_Codigo,PER_Codigo, " &
                              "ALE_USU_Envia,ALE_USU_Recibe,ALE_FEC_Ingreso, " &
                              "ALE_FEC_Lectura,ALE_Descripcion,ALE_Tipo, " &
                              "ALE_Prioriza,ALE_Evento,ALE_Activo) " &
                              "VALUES(@cia,@suc,@tipo,@dcaCodigo, " &
                              "@pickCodigo,@asignador,null,getDate(),null, " &
                              "@mensaje,'01',@prio,@evento,'1')"

        Dim comando As New SqlCommand
        With comando
            .Connection = coneccion
            .CommandText = query
            .Parameters.AddWithValue("@cia", cia)
            .Parameters.AddWithValue("@suc", suc)
            .Parameters.AddWithValue("@tipo", tdoc)
            .Parameters.AddWithValue("@dcaCodigo", pedido)
            .Parameters.AddWithValue("@pickCodigo", pickeador)
            .Parameters.AddWithValue("@asignador", usuario)
            .Parameters.AddWithValue("@mensaje", mensaje)
            .Parameters.AddWithValue("@prio", prio)
            .Parameters.AddWithValue("@evento", evento)
            .ExecuteNonQuery()
        End With
        coneccion.Close()
    End Sub

End Class
